﻿@import "../../core/less/import.less";
@select-pre: ~"@{ui}-select";

.@{select-pre} {
    display: inline-block;
    position: relative;
    .clearfix;
    .transition(background @animate-time-fast cubic-bezier(0.075, 0.82, 0.165, 1));

    &-selection {
        display: inline-block;
        position: relative;
        border: 1px solid @color-border-normal;
        border-radius: 4px;
        width: 100%;
        font-size: 12px;
        cursor: pointer;
        .middle-vertical(30px);
        .transition(all @animate-time-fast+0.05 cubic-bezier(0.12, 0.4, 0.29, 1.46) @animate-time-fast);
        .ut-clearfix;

        .@{select-pre}-selection-value {
            display: inline-block;
            float: left;
            padding-left: 10px;
        }

        .@{ui}-icon {
            float: right;
            margin-right:10px;
            font-size: 14px;
            .transition(transform @animate-time-fast+0.05 ease);
        }

        &:hover {
            border-color: @color-primary;
        }
    }

    &-input {
        display: none;
    }

    &-options {
        width: 100%;
        background-color: @color-background;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
        border-radius: 4px;
        z-index: 1050;
        position: absolute;
        overflow-y: auto;
        font-size: 12px;
        outline: none;
        margin-bottom: 0;
        max-height: 250px;
        display: none;

        .@{select-pre}-option {
            position: relative;
            display: block;
            width: 90%;
            padding: 10px 5%;
            font-weight: normal;
            color: @color-text-normal;
            cursor: pointer;
            white-space: nowrap;
            overflow: hidden;
            .transition(background 0.2s ease);

            &:hover {
                background-color: fade(@color-primary, 10%);
            }
        }

        .@{select-pre}-option-selected {
            background-color: @color-background-normal;
        }
    }
}

.@{select-pre}-large {
    .@{select-pre}-selection {
        .middle-vertical(38px);
    }
}

.@{select-pre}-small {
    .@{select-pre}-selection {
        .middle-vertical(22px);
    }
}

.@{select-pre}-hover {
    .@{select-pre}-selection {
        border-color: @color-primary;
    }
}

.@{select-pre}-disabled {

    .@{select-pre}-selection {
        cursor: default;
        background-color: @color-background-normal;
        border-color: @color-disabled;
        color: @color-disabled;

        &:hover {
            border-color: @color-disabled;
        }
    }
}

.@{select-pre}-open {
    .@{select-pre}-selection {
        border-color: @color-primary;
        box-shadow: 0 0 0 2px rgba(16, 142, 233, 0.2);

        .@{ui}-icon {
            .transform(rotate(180deg));
        }
    }

    .@{select-pre}-options {
        display: block;
    }
}
